package cn.wolfcode.service.impl;

import cn.wolfcode.domain.Systemdictionaryitem;
import cn.wolfcode.mapper.SystemdictionaryitemMapper;
import cn.wolfcode.quest.SystemDictionaryItemQuery;
import cn.wolfcode.service.ISystemdictionaryitemService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SystemdictionaryitemServiceImpl implements ISystemdictionaryitemService {
    @Autowired
    private SystemdictionaryitemMapper mapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return mapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Systemdictionaryitem record) {
        return mapper.insert(record);
    }

    @Override
    public Systemdictionaryitem selectByPrimaryKey(Long id) {
        return mapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Systemdictionaryitem> selectAll() {
        return mapper.selectAll();
    }

    @Override
    public int updateByPrimaryKey(Systemdictionaryitem record) {
        return mapper.updateByPrimaryKey(record);
    }

    @Override
    public PageInfo selectList(SystemDictionaryItemQuery qo) {
        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize(),"sequence asc");
        List<Systemdictionaryitem> list=mapper.selectList(qo);

        return new PageInfo(list);
    }

    @Override
    public int selectMaxSequence(Long id) {
        return mapper.selectMaxSequence(id);
    }

    @Override
    public List<Systemdictionaryitem> selectByParentId(long parentId) {
        return mapper.electByParentId(parentId);
    }

    @Override
    public List<Systemdictionaryitem> selectBySn(String sn) {
        return mapper.selectBySn(sn);
    }
}
